﻿<%@ Page Language="C#" AutoEventWireup="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />
    <title>KPIReport - Login</title>
    <link rel="stylesheet" href="styles/blitzer/jquery-ui-1.9.2.custom.min.css" type="text/css" />
    <link rel="stylesheet" href="styles/home.css" type="text/css" />
    <link rel="stylesheet" href="styles/button.css" type="text/css" />
    <link rel="stylesheet" href="styles/CustomJquery.css" type="text/css" />
    <link href="styles/jquery.realperson.css" rel="stylesheet" type="text/css" />
    <script src="scripts/jquery-1.9.0.min.js" type="text/javascript"></script>
    <script src="scripts/jquery-ui-1.9.2.custom.min.js" type="text/javascript"></script>
    <script src="scripts/jquery.sha1.js" type="text/javascript"></script>
    <script src="scripts/jquery.realperson.min.js" type="text/javascript"></script>
     <script src="<%= ResolveUrl("~/scripts/jquery.msgBox.v1.js") %>" type="text/javascript"></script>
     <link rel="shortcut icon" href="images/favicon_favicon.png" >
    <script type="text/javascript">

        $(document).ready(function () {
            $('#hrfForgotPassword').click(function () {
                var formUrl = '<%= ResolveUrl("~/forms/authentication/forgotpassword.aspx") %>';

                $('#dialog1').load(formUrl).dialog({
                    autoOpen: false, modal: true, width: 450, title: 'Lupa Password',
                    close: function (event, ui) {
                        $('#dialog1').empty().dialog('destroy');
                    }
                });

                $("#dialog1").dialog('open');

                return false;

            });


            $('#btnMasuk').click(function () {

                var kode = $('#txtKode').val();
                var pwd = $('#txtPassword').val();
                var isPersistent = $('#cbIsPersistent').is(":checked");
                var objUser = new Object();
                objUser.UserCode = encodeURIComponent(kode);
                objUser.IsPersistent = isPersistent;

                if (typeof ($('#txtPassword').val()) != 'undefined')
                    objUser.Password = encodeURIComponent($.sha1($('#txtPassword').val()));

                jsonData = JSON.stringify(objUser);

                $.ajax({
                    type: 'POST',
                    url: 'ajaxhandler/authentication/loginhandler.ashx',
                    contentType: 'application/json',
                    dataType: 'json',
                    data: jsonData,
                    success: function (data) {

                        if (data.IsValid == 'True') {

                            window.location = data.DefaultUrl;

                        }
                        else {
                            //alert(data.Message);
                            $.msgBox(data.Message, null, { title: "Pesan Error" });
                        }

                    },
                    error: function (response) {
                        var r = JSON.parse(response.responseText);
                        //alert("Error Message: " + r.Message);
                        $.msgBox("Error Message: " + r.Message, null, { title: "Pesan Error" });
                    }
                });

                return false;

            });

        });

    </script>
</head>
<body>
    <form id="frmLogin" method="post" action="">
    <div class="container">
        <div class="content">
            <div class="fltlft leftku">
                <div class="logo_index">
                   <%-- <img src="images/depanJobDesc.png" width="300" alt="PT.Fastrata Buana" />--%>

                     <img src="images/logo_FB.png" width="200" alt="PT.Fastrata Buana" />
                </div>
                <div class="nama_aplikasi">
                    <%--<img src="images/logo_FB.png" width="200" alt="PT.Fastrata Buana" />--%>
                </div>
            </div>
            <div class="loginku">
                <table width="650" height="50" border="0" cellspacing="5" cellpadding="0" class="form_login">
                    <tr>
                        <td width="100">
                            <b><span style="color:Blue;" >Email:</span></b>
                        </td>
                        <td>
                            <input type="text" size="25" class="inputTxt" id="txtKode" name="txtKode" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <b><span style="color:Blue;" >Sandi :</span></b>
                        </td>
                        <td>
                            <input type="password" size="25" class="inputTxt" id="txtPassword" name="txtPassword" />
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr runat="server" visible="false">
                        <td>
                            &nbsp;
                        </td>
                        <td>
                            <input id="cbIsPersistent" name="cbIsPersistent" type="checkbox" value="" />Biarkan
                            saya tetap masuk
                        </td>
                        <td>
                        </td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td align="right">
                            <input name="btnMasuk" style="color:Blue;" id="btnMasuk" type="submit" value="Masuk" class="button" />
                        </td>
                        <td>
                        </td>
                    </tr>
                </table>
                <!--end login-->
            </div>
            <div class="footer">
                <br />
                <br />
                <br />
                <br />
                <br />
                <br />
                <br />
                <br />
                <br />
                <br />
                2014 &copy; Hak Cipta dimiliki PT.Fastrata Buana
                <!-- end .footer -->
            </div>
        </div>
        <!-- end .content -->
    </div>
    <!-- end .container -->
    <input type="hidden" id="txtExpire" value="0" />
    <div id="dialog1" title="Default dialog">
    </div>
    <div id="dialog-confirm" title="Konfirmasi">
    </div>
    </form>
</body>
</html>
